<?php 
 include '../config/config.php';

/*$banner_header = mysql_real_escape_string($_POST['banner_header']);
$content_title = mysql_real_escape_string($_POST['content_title']);
$contents = mysql_real_escape_string($_POST['content']);

$footer1 = mysql_real_escape_string($_POST['footer1']);
$footercontent1 = mysql_real_escape_string($_POST['footercontent1']);

$sql = "UPDATE $tbl_name SET header='$banner_header', contenttitle='$content_title', content='$contents' ";
//$sql = "INSERT INTO $tbl_name(header, contenttitle, content)VALUES('$banner_header', '$content_title', '$contents')";
$r = mysql_query($sql);

if ($r) {
	echo "ok";
}else {
	echo "not ok";

}


$sql2 = "UPDATE $tbl_name2  SET footertitle1='$footer1', footercontent2='$footercontent1' ";
//$sql2 = "INSERT INTO $tbl_name2(footertitle1, footercontent2)VALUES('$footer1', '$footercontent1')";
$r2 = mysql_query($sql2);

if ($r2) {
	echo "ok";
}else {
	echo "not ok";

}*/

if (isset($_POST['action'])) {

	if($_POST['action'] == "Insert"){
		$value1 = mysql_real_escape_string($_POST['value1']);
		$value2 = mysql_real_escape_string($_POST['value2']);
		$value3 = mysql_real_escape_string($_POST['value3']);
		$sql = "INSERT INTO $tbl_name(header, contenttitle, content)VALUES('$value1', '$value2', '$value3')";
		//$sql= "UPDATE $tbl_name SET header='$value1', contenttitle='$value2', content='$value3'";
		$r = mysql_query($sql);
	}
	elseif ($_POST['action'] == "updateInsert") {
		$value1 = mysql_real_escape_string($_POST['value1']);
		$value2 = mysql_real_escape_string($_POST['value2']);
		//$sql = "INSERT INTO $tbl_name(header)VALUES('$value')";
		$sql2= "UPDATE footer1 SET footertitle1='$value1', footercontent1='$value2'";
		$r2 = mysql_query($sql2);
	}

}



?>